package com.zw.goodsservice.common.constant;

public enum TypeNameEnum {
    FASHION(1, "时尚"), ELECTRONIC(2, "电子"), FOOD(3, "食品"), OTHER(4, "其他"),
    IPHONE(5, "苹果手机"), HUAWEI(6, "华为手机"), XIAOMI(7, "小米手机"), OPPO(8, "OPPO手机");

    public final Integer code;

    public final String name;

    TypeNameEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(Integer code) {
        for (TypeNameEnum typeNameEnum : TypeNameEnum.values()) {
            if (typeNameEnum.code.equals(code)) {
                return typeNameEnum.name;
            }
        }
        return null;
    }
}
